import requests
import random
import time


url = 'http://mku.shundaoyun.com/index/post/bd_addpoindo.html'

# 代理服务器
proxyHost = "http-dyn.abuyun.com"
proxyPort = "9020"

# 代理隧道验证信息
proxyUser = "HP7STDZ11807EX6D"
proxyPass = "8BBCAB4CFFAD5079"

proxyMeta = "http://%(user)s:%(pass)s@%(host)s:%(port)s" % {
    "host" : proxyHost,
    "port" : proxyPort,
    "user" : proxyUser,
    "pass" : proxyPass,
}

proxies = {
    "http"  : proxyMeta,
    "https" : proxyMeta,
}

head = {
    'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.3(0x17000321) NetType/WIFI Language/zh_CN',
    'referer': 'https://servicewechat.com/wx80d67a87dd14a25e/2/page-frame.html',
    'accept-encoding': 'accept-encoding'
}

def getMySelf():
    res = requests.post(url, headers = head, data = {'id': 192}, proxies=proxies, timeout=60)
    data = res.json();
    print('getMySelf------------------------------------------------------')
    print(data)
    return data

while True:
    print(time.strftime('%Y-%m-%d %X',time.localtime()))    
    getMySelf()  # 此处为要执行的任务   
    num = random.randint(1,3) 
    time.sleep(num)

# getMySelf()

